<?php $model = new Administrator_Model_Product_View();
$model->updateProducthit($this->id);
$info = $model->GetProductInfo($this->id);
$catinfo = $model->GetPro_catInfo($info['cat']);
$translate = new Front_Model_Translate();
$typeinfo = $model->GetProduct_type($info['type']);
$storeinfo = $model->GetProduct_type($info['store']);
$maninfo = $model->GetProduct_manufactInfo($info['manufact']);
$curinfo = $model->GetPro_curInfo($info['currency']);
?>
<div class="bread">
	<ul>
		<li class="first"><a href="<?php echo BASE_URL?>/">Trang chủ</a></li>
		<?php 
		echo '<li><a href="'.$translate->ProStoreLink($info['store'], $this->request['lang']).'">'.$storeinfo['name'].'</a></li>';
		echo '<li><a href="'.$translate->ProTypeLink($info['type'], $this->request['lang']).'">'.$typeinfo['name'].'</a></li>';
		echo '<li><a href="'.$translate->ProCatLink($info['cat'], $this->request['lang']).'">'.$catinfo['name'].'</a></li>';
		echo '<li>'.$info['name'].'</li>';
		?>
	</ul>
</div>
<div class="content">
	<div class="pro">
		<div class="thumb"><img src="<?php echo $model->ImageUrl('product', $info['image'])?>"></div>
		<div class="details">
			<div class=" elem name"><?php echo $info['name']?></div>
			<div class="elem"><div class="hint">Giá : </div><span class="price"><?php echo $model->FormatFloatNumber($info['price'])?></span><span class="cur"><?php echo $curinfo['name']?></span></div>
			<div class="elem"><div class="hint">NSX : </div><a href="<?php echo $translate->ProManufactLink($info['manufact'], $this->request['lang'])?>"><?php echo $maninfo['name']?></a></div>
			<div class="elem"><div class="hint">Lượt xem : </div><span><?php echo $info['hit']?></span></div>
			<div class="elem"><div class="hint">Lượt mua : </div><span><?php echo $info['sell']?></span></div>
			<div class="info"><a href="#"><?php echo $storeinfo['name']?></a>,<a href="#"><?php echo $typeinfo['name']?></a>,<a href="#"><?php echo $catinfo['name']?></a></div>
			<div class="info"><span class="more">Tags : </span>
			<?php 
			$i = 0;
			foreach ($model->GetTagByContent($this->id) as $value) {
				if($i == 0) echo '<a href="'.$translate->ProTagLink($value['tag'], $this->request['lang']).'">'.$model->GetTagname($value['tag']).'</a>';
				else echo ',<a href="'.$translate->ProTagLink($value['tag'], $this->request['lang']).'">'.$model->GetTagname($value['tag']).'</a>';
				$i++;
			} 
			
			?>
			</div>
			<div class="addthis">
			<!-- AddThis Button BEGIN -->
			<div class="addthis_toolbox addthis_default_style ">
			<a class="addthis_button_facebook_like"></a>
			<a class="addthis_button_google_plusone"></a>
			<a class="addthis_button_preferred_2"></a>
			<a class="addthis_button_preferred_3"></a>
			<a class="addthis_button_preferred_4"></a>
			<a class="addthis_button_compact"></a>
			<a class="addthis_counter addthis_bubble_style"></a>
			</div>
			<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f7ef70b4ef95a11"></script>
			<!-- AddThis Button END -->
			</div>
		</div>
		<div class="clear"></div>
		<div class="ptab">
			<div class="toptab">
				<div class="titletab active" title="1"><span>Thông tin sản phẩm</span></div>
				<div class="titletab" title="2"><span>Thông số kỹ thuật</span></div>
				<div class="titletab end" title="3"><span>Thông tin liên hệ/Bảo hành</span></div>
				<div class="titletab related" title="4"><span>Sản phẩm cùng loại</span></div>
			</div>
			<div class="midtab">
				<div class="1"><?php echo $info['intro']?></div>
				<div class="2"><?php echo $info['attribute']?></div>
				<div class="3"><?php echo $info['warranty']?></div>
				<div class="4 product">
			<?php foreach ($model->GetRelatedProductIncat($this->id, 5) as $value) {
				echo '<div class="item">';
					echo '<a href="'.$translate->ProdetailsLink($value['id'], $this->request['lang']).'"><img src="'.$model->ImageUrl('product', $value['image']).'">'.$value['name'].'</a>';
					echo '<div class="intro">';
					$curinfo = $model->GetPro_curInfo($value['currency']);	
						echo '<span class="price">'.$model->FormatFloatNumber($value['price']).'</span>';
						echo '<span class="curr">'.$curinfo['name'].'</span>';
					echo '</div>';
				echo '</div>';
			} 
			
			?>
				</div>
			</div>
		</div>	
		<script type="text/javascript">
		$('.content .pro .ptab .midtab .1').css('display','block');
		$('.content .pro .ptab .toptab .titletab').click(function(){
			$('.content .pro .ptab .toptab .active').removeClass('active');
			$(this).addClass('active');
			var temp = $(this).attr('title');
			$('.content .pro .ptab .midtab>div').css('display','none');
			$('.content .pro .ptab .midtab .'+temp).css('display','block');
		});
		</script>
		<div class="product related">
		<?php foreach ($model->GetRelatedProductInType($this->id, 5) as $value) {
				echo '<div class="item rlt">';
					echo '<a href="'.$translate->ProdetailsLink($value['id'], $this->request['lang']).'"><img src="'.$model->ImageUrl('product', $value['image']).'">'.$value['name'].'</a>';
					echo '<div class="intro">';
					$curinfo = $model->GetPro_curInfo($value['currency']);	
						echo '<span class="price">'.$model->FormatFloatNumber($value['price']).'</span>';
						echo '<span class="curr">'.$curinfo['name'].'</span>';
					echo '</div>';
				echo '</div>';
			} 
			
			?>
		</div>	
	</div>
</div><!-- end content -->
<div class="sidebar">
<?php echo $this->blksupport($this->request,$this->dirImg)?>
<?php echo $this->blkadv($this->request,$this->dirImg,"right")?>
<?php echo $this->blktopproduct($this->request,BASE_URL.'/public/images/product')?>
<?php echo $this->blkadv($this->request,$this->dirImg,"rightbot")?>
</div><!-- end sidebar -->
<div class="pay"><img src="<?php echo $this->dirImg?>/pay.png"></div>